# coding=utf-8
import zmq
context = zmq.Context()

print "Connecting to server..."
socket = context.socket(zmq.REQ)
socket.connect ("tcp://localhost:5555")

x = raw_input('input something(q to exit):')
while not x is 'q':
    socket.send (x)
    message = socket.recv()
    print 'Received:', message
    x = raw_input('input something(q to exit):')